package main

import (
	// "encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
)

func GetMethod01() {
	u, _ := url.Parse("http://127.0.0.1:8082/server")
	q := u.Query()
	q.Set("username", "Long")
	q.Set("password", "hahahah")
	u.RawQuery = q.Encode()
	res, err := http.Get(u.String())
	if err != nil {
		log.Fatal(err)
		return
	}
	result, err := ioutil.ReadAll(res.Body)
	res.Body.Close()
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Printf("Request result data is : %s\n", result)
}

func main() {
	for i := 0; i < 10; i++ {
		GetMethod01()
	}
}
